package com.ldx.java_chatroom.mapper;

import com.ldx.java_chatroom.model.Friend;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FriendMapper {

    @Select("select userId as friendId, username as friendName from user where userId in " +
            "(select friendId from friend where userId = #{userId})")
    List<Friend> getFriendList(Integer userId);
}
